home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / QuickdrawText.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  6.5 KB  |  162 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        QuickdrawText.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __QUICKDRAWTEXT__
  13. #define __QUICKDRAWTEXT__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22. #ifndef __INTLRESOURCES__
  23. #include <IntlResources.h>
  24. #endif
  25.  
  26. enum  {
  27. /* CharToPixel directions */
  28.     leftCaret                    = 0,                            /*Place caret for left block*/
  29.     rightCaret                    = -1,                            /*Place caret for right block*/
  30.     hilite                        = 1,                            /*Direction is SysDirection*/
  31.     smLeftCaret                    = 0,                            /*Place caret for left block          obsolete */
  32.     smRightCaret                = -1,                            /*Place caret for right block      obsolete */
  33.     smHilite                    = 1,                            /*Direction is TESysJust              obsolete */
  34. /*Constants for styleRunPosition argument in PortionLine, DrawJustified,
  35.  MeasureJustified, CharToPixel, and PixelToChar.*/
  36.     onlyStyleRun                = 0,                            /* This is the only style run on the line */
  37.     leftStyleRun                = 1,                            /* This is leftmost of multiple style runs on the line */
  38.     rightStyleRun                = 2,                            /* This is rightmost of multiple style runs on the line */
  39.     middleStyleRun                = 3,                            /* There are multiple style runs on the line and this 
  40.  is neither the leftmost nor the rightmost. */
  41.     smOnlyStyleRun                = 0,                            /*      obsolete */
  42.     smLeftStyleRun                = 1,                            /*      obsolete */
  43.     smRightStyleRun                = 2,                            /*      obsolete */
  44.     smMiddleStyleRun            = 3                                /*      obsolete */
  45. };
  46.  
  47.  
  48. /* type for styleRunPosition parameter in PixelToChar etc. */
  49.  
  50. typedef short JustStyleCode;
  51.  
  52. #if defined(powerc) || defined (__powerc)
  53. #pragma options align=mac68k
  54. #endif
  55. struct FontInfo {
  56.     short                        ascent;
  57.     short                        descent;
  58.     short                        widMax;
  59.     short                        leading;
  60. };
  61. #if defined(powerc) || defined(__powerc)
  62. #pragma options align=reset
  63. #endif
  64.  
  65. typedef struct FontInfo FontInfo;
  66.  
  67. typedef short FormatOrder[1];
  68.  
  69. typedef FormatOrder *FormatOrderPtr;
  70.  
  71. typedef short FormatStatus;
  72.  
  73. #ifdef __cplusplus
  74. extern "C" {
  75. #endif
  76.  
  77. extern pascal short Pixel2Char(Ptr textBuf, short textLen, short slop, short pixelWidth, Boolean *leadingEdge)
  78.  FOURWORDINLINE(0x2F3C, 0x820E, 0x0014, 0xA8B5);
  79. extern pascal short Char2Pixel(Ptr textBuf, short textLen, short slop, short offset, short direction)
  80.  FOURWORDINLINE(0x2F3C, 0x820C, 0x0016, 0xA8B5);
  81. extern pascal short PixelToChar(Ptr textBuf, long textLength, Fixed slop, Fixed pixelWidth, Boolean *leadingEdge, Fixed *widthRemaining, JustStyleCode styleRunPosition, Point numer, Point denom)
  82.  FOURWORDINLINE(0x2F3C, 0x8222, 0x002E, 0xA8B5);
  83. extern pascal short CharToPixel(Ptr textBuf, long textLength, Fixed slop, long offset, short direction, JustStyleCode styleRunPosition, Point numer, Point denom)
  84.  FOURWORDINLINE(0x2F3C, 0x821C, 0x0030, 0xA8B5);
  85. extern pascal void DrawJustified(Ptr textPtr, long textLength, Fixed slop, JustStyleCode styleRunPosition, Point numer, Point denom)
  86.  FOURWORDINLINE(0x2F3C, 0x8016, 0x0032, 0xA8B5);
  87. extern pascal void MeasureJustified(Ptr textPtr, long textLength, Fixed slop, Ptr charLocs, JustStyleCode styleRunPosition, Point numer, Point denom)
  88.  FOURWORDINLINE(0x2F3C, 0x801A, 0x0034, 0xA8B5);
  89. extern pascal Fixed PortionLine(Ptr textPtr, long textLen, JustStyleCode styleRunPosition, Point numer, Point denom)
  90.  FOURWORDINLINE(0x2F3C, 0x8412, 0x0036, 0xA8B5);
  91. extern pascal void HiliteText(Ptr textPtr, short textLength, short firstOffset, short secondOffset, OffsetTable offsets)
  92.  FOURWORDINLINE(0x2F3C, 0x800E, 0x001C, 0xA8B5);
  93. extern pascal void DrawJust(Ptr textPtr, short textLength, short slop)
  94.  FOURWORDINLINE(0x2F3C, 0x8008, 0x001E, 0xA8B5);
  95. extern pascal void MeasureJust(Ptr textPtr, short textLength, short slop, Ptr charLocs)
  96.  FOURWORDINLINE(0x2F3C, 0x800C, 0x0020, 0xA8B5);
  97. extern pascal Fixed PortionText(Ptr textPtr, long textLength)
  98.  FOURWORDINLINE(0x2F3C, 0x8408, 0x0024, 0xA8B5);
  99. extern pascal long VisibleLength(Ptr textPtr, long textLength)
  100.  FOURWORDINLINE(0x2F3C, 0x8408, 0x0028, 0xA8B5);
  101. extern pascal void GetFormatOrder(FormatOrderPtr ordering, short firstFormat, short lastFormat, Boolean lineRight, Ptr rlDirProc, Ptr dirParam)
  102.  FOURWORDINLINE(0x2F3C, 0x8012, 0xFFFC, 0xA8B5);
  103. extern pascal void TextFont(short font)
  104.  ONEWORDINLINE(0xA887);
  105. extern pascal void TextFace(short face)
  106.  ONEWORDINLINE(0xA888);
  107. extern pascal void TextMode(short mode)
  108.  ONEWORDINLINE(0xA889);
  109. extern pascal void TextSize(short size)
  110.  ONEWORDINLINE(0xA88A);
  111. extern pascal void SpaceExtra(Fixed extra)
  112.  ONEWORDINLINE(0xA88E);
  113. extern pascal void DrawChar(short ch)
  114.  ONEWORDINLINE(0xA883);
  115. extern pascal void DrawString(ConstStr255Param s)
  116.  ONEWORDINLINE(0xA884);
  117. extern pascal void DrawText(const void *textBuf, short firstByte, short byteCount)
  118.  ONEWORDINLINE(0xA885);
  119. extern pascal short CharWidth(short ch)
  120.  ONEWORDINLINE(0xA88D);
  121. extern pascal short StringWidth(ConstStr255Param s)
  122.  ONEWORDINLINE(0xA88C);
  123. extern pascal short TextWidth(const void *textBuf, short firstByte, short byteCount)
  124.  ONEWORDINLINE(0xA886);
  125. extern pascal void MeasureText(short count, const void *textAddr, void *charLocs)
  126.  ONEWORDINLINE(0xA837);
  127. extern pascal void GetFontInfo(FontInfo *info)
  128.  ONEWORDINLINE(0xA88B);
  129. extern pascal void CharExtra(Fixed extra)
  130.  ONEWORDINLINE(0xAA23);
  131. extern pascal void StdText(short count, const void *textAddr, Point numer, Point denom)
  132.  ONEWORDINLINE(0xA882);
  133. extern void stdtext(short count, const void *textAddr, Point *numer, Point *denom);
  134. extern pascal short StdTxMeas(short byteCount, const void *textAddr, Point *numer, Point *denom, FontInfo *info)
  135.  ONEWORDINLINE(0xA8ED);
  136. #if OLDROUTINENAMES
  137. #define NPixel2Char(textBuf, textLen, slop, pixelWidth, leadingEdge, widthRemaining, styleRunPosition, numer, denom)  \
  138.     PixelToChar(textBuf, textLen, slop, pixelWidth, leadingEdge, widthRemaining,  \
  139.     styleRunPosition, numer, denom)
  140.  
  141. #define NChar2Pixel(textBuf, textLen, slop, offset, direction, styleRunPosition, numer, denom)  \
  142.     CharToPixel(textBuf, textLen, slop, offset, direction, styleRunPosition,  \
  143.     numer, denom)
  144.  
  145. #define NDrawJust(textPtr, textLength, slop, styleRunPosition, numer, denom)  \
  146.     DrawJustified(textPtr, textLength, slop, styleRunPosition, numer, denom)
  147.  
  148. #define NMeasureJust(textPtr, textLength, slop, charLocs, styleRunPosition, numer, denom)  \
  149.     MeasureJustified(textPtr, textLength, slop, charLocs, styleRunPosition, numer, denom)
  150.  
  151. #define NPortionText(textPtr, textLen, styleRunPosition, numer, denom)  \
  152.     PortionLine(textPtr, textLen, styleRunPosition, numer, denom)
  153.  
  154. #endif
  155.  
  156. #ifdef __cplusplus
  157. }
  158. #endif
  159.  
  160. #endif
  161.  
  162.